import { createRouter,createWebHashHistory, createWebHistory } from "vue-router";
import Home from "../views/Home/Home/Home.vue";
import App from "../App.vue";
import Index from "../views/Home/Index.vue";
import  Food from '../views/Home/Food/Food.vue'
import Light from '../views/Home/Light/Light.vue'
import Mine from '../views/Home/Mine/Mine.vue'
import Inventory from '../views/Home/Food/Inventory.vue'
import Orders from '../views/Home/Food/Orders.vue'
import Shop from '../views/Home/Food/Shop.vue'
const routes=[
    {
        path:'/',
        redirect:'/index'
    },

    
    {
        path:'/index',
        name:'index',
        component:Index,
        children:[
            {
                path:'/index',
                redirect:'/home'
            },
            {
                path:'/home',
                name:'home',
                component:Home
            },
            
            {
                path:'/light',
                name:'light',
                component:Light
            },
            {
                path:'/mine',
                name:'mine',
                component:Mine
            },

        ]
    },
    {
        path:'/food',
        name:'food',
        component:Food,
        children:[
            {
                path:'/inventory',
                name:'inventory',
                component:Inventory
            },
            {
                path:'/orders',
                name:'orders',
                component:Orders
            },
            {
                path:'/shop',
                name:'shop',
                component:Shop
            },
        ]
            },
   


]

const router = createRouter({
    history: createWebHistory(),
    routes
})

export default router;// 创建一个路由器实例
